﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="UserInfo.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.Saf.Actions.Wss.Entities
{
    using System.Xml.Serialization;
    using System;

    using SharePoint.Wss.Attributes;
    using SharePoint.Wss.Entities;

    [CollaborisClass(
         Title = "User Info",
         ReleaseStatus = ReleaseStatus.Beta,
         DisableDocumentation = false,
         ContactAuthorEmail = "Support@Collaboris.co.uk",
         Summary = "Defines the parameters to define a user account."
        )]
    [Serializable]
    public class UserInfo : WSSEntityBase
    {

        private bool? makeAdmin;

        private string loginName;

        private string emailAddress;

        private string notes;

        private string name;

        [CollaborisProperty(
              Summary = "Specifies whether to set the user as a site collection administrator.",
              Title = "Make Admin",
              Example = "true",
              Required = false,
              InputHint = InputHint.NullableBoolean)]
        [XmlElement(IsNullable = true)] 
        public bool? MakeAdmin
        {
            get
            {
                return this.makeAdmin;
            }
            set
            {
                this.makeAdmin = value;
            }
        }

        [CollaborisProperty(
              Summary = "Specifies the login name for the user.",
              Title = "Login Name",
              Example = @"${USERDOMAIN}\${USERNAME}",
              Required = true,
              InputHint = InputHint.SingleText)]
        [XmlAttribute]
        public string LoginName
        {
            get
            {
                return this.loginName;
            }
            set
            {
                this.loginName = value;
            }
        }

        [CollaborisProperty(
             Summary = "Specifies the email address for the user.",
             Title = "Email Address",
             Example = "suppport@collaboris.co.uk",
             Required = false,
             InputHint = InputHint.SingleText)]
        [XmlAttribute]
        public string EmailAddress
        {
            get
            {
                return this.emailAddress;
            }
            set
            {
                this.emailAddress = value;
            }
        }

        [CollaborisProperty(
             Summary = "Specifies any additional notes for the user.",
             Title = "Notes",
             Example = "The user operates as Accounts admin.",
             Required = false,
             InputHint = InputHint.SingleText)]
        [XmlAttribute]
        public string Notes
        {
            get
            {
                return this.notes;
            }
            set
            {
                this.notes = value;
            }
        }

        [CollaborisProperty(
             Summary = "Specifies the name of the user.",
             Title = "Login Name",
             Example = "${USERNAME}",
             Required = true,
             InputHint = InputHint.SingleText)]
        [XmlAttribute]
        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }
    }
}
